<div class="articles form">
<?php echo $this->Form->create('Article');?>
	<fieldset>
		<legend><?php __('Comprar Artículo'); ?></legend>
	<?php
		echo $this->Form->input('id', array('value'=>$valor_id, 'type'=>'hidden'));
		echo $this->Form->input('marca', array('label'=>'Marca', 'default' => $marca, 'readonly' => 'readonly'));
		echo $this->Form->input('modelo', array('label'=>'Modelo', 'default' => $modelo, 'readonly' => 'readonly'));
		echo $this->Form->input('cantidad', array('label'=>'Cantidad'));
                echo $this->Form->input('fecha', array('label' => 'Fecha de Compra', 'type' => 'text'));
                if(!empty($ultimo_proveedor)){
                    echo $this->Form->input('supplier_id', array('label' => 'Proveedor', 'default' => $ultimo_proveedor[0]['suppliers']['id']));
                }else{
                    echo $this->Form->input('supplier_id', array('label' => 'Proveedor'));
                }
	?>
	</fieldset>
<?php echo $this->Form->end(__('Guardar', true));?>
</div>
<script type="text/javascript">
    (function($){
        // Date picker
        $("#ArticleFecha").datepicker({
            //yearRange: '1970:2010',
            defaultDate: new Date(),
            dateFormat: 'dd/mm/yy',
            changeMonth: true,
            changeYear: true
        });
        
        //toda la documentacion de esta librería la encontras aca
        //http://jqueryui.com/demos/datepicker/
    })(jQuery);
</script>